package ru.osu.acm.testing.solutions;

import java.io.*;
import java.util.StringTokenizer;
import java.util.Arrays;

/**
 * User: Aleksey
 * Date: 16.01.2009
 * Time: 1:51:36
 */
public class Task14 implements Runnable {
    private static BufferedReader br = null;
    private static PrintWriter pw = null;
    private static StringTokenizer st = new StringTokenizer("");

    private void nline() {
        try {
            st = new StringTokenizer(br.readLine());
        }
        catch (IOException e) {
            throw new RuntimeException("RuntimeException");
        }
    }

    private int ni() {
        while (!st.hasMoreTokens()) nline();
        return Integer.parseInt(st.nextToken());
    }

    private long nl() {
        while (!st.hasMoreTokens()) nline();
        return Long.parseLong(st.nextToken());
    }

    private double nd() {
        while (!st.hasMoreTokens()) nline();
        return Double.parseDouble(st.nextToken());
    }

    private String ns() {
        while (!st.hasMoreTokens()) nline();
        return st.nextToken();
    }

    private void solve() {
        int n = ni();
        boolean[][] m = new boolean[n][n];
        for (int i = 0; i < n; i++) {
            int k = ni();
            for (int j = 0; j < k; j++) {
                int v = ni();
                m[i][v] = true;
                m[v][i] = true;
            }
        }
        int cnt = 0;
        for (int i = 0; i < n; i++) {
            if (m[0][i]) {
                cnt++;
            }
        }
        if (cnt <= 6) {
            int[] ids = new int[cnt];
            int k = 0;
            for (int i = 0; i < n; i++) {
                if (m[0][i]) {
                    ids[k++] = i;
                }
            }
            int[] counts = new int[cnt];
            for (int i = 0; i < cnt; i++) {
                for (int j = 0; j < n; j++) {
                    if (m[ids[i]][j]) {
                        counts[i]++;
                    }
                }
            }
            for (int i = 0; i < cnt; i++) {
                counts[i]--;
            }
            Arrays.sort(counts);

            if (cnt == 0) {
                pw.println("yes");
            }
            else if (cnt == 1) {
                if (counts[0] <= 5) {
                    pw.println("yes");
                }
                else {
                    pw.println("no");
                }
            }
            else if (cnt == 2) {
                if (counts[0] <= 5 && counts[1] <= 5) {
                    pw.println("yes");
                }
                else {
                    pw.println("no");
                }
            }
            else if (cnt == 3) {
                if ((counts[0] <= 3 && counts[1] <= 4 && counts[2] <= 5) ||
                        (counts[0] <= 4 && counts[1] <= 4 && counts[2] <= 4)) {
                    pw.println("yes");
                }
                else {
                    pw.println("no");
                }
            }
            else if (cnt == 4) {
                if ((counts[0] <= 2 && counts[1] <= 2 && counts[2] <= 3 && counts[3] <= 5) ||
                        (counts[0] <= 1 && counts[1] <= 3 && counts[2] <= 3 && counts[3] <= 5) ||
                        (counts[0] <= 1 && counts[1] <= 3 && counts[2] <= 4 && counts[3] <= 4) ||
                        (counts[0] <= 2 && counts[1] <= 2 && counts[2] <= 4 && counts[3] <= 4) ||
                        (counts[0] <= 2 && counts[1] <= 3 && counts[2] <= 3 && counts[3] <= 4) ||
                        (counts[0] <= 3 && counts[1] <= 3 && counts[2] <= 3 && counts[3] <= 3)) {
                    pw.println("yes");
                }
                else {
                    pw.println("no");
                }
            }
            else if (cnt == 5) {
                if ((counts[0] <= 1 && counts[1] <= 2 && counts[2] <= 2 && counts[3] <= 3 && counts[4] <= 4) ||
                        (counts[0] <= 1 && counts[1] <= 1 && counts[2] <= 3 && counts[3] <= 3 && counts[4] <= 4) ||
                        (counts[0] <= 2 && counts[1] <= 2 && counts[2] <= 2 && counts[3] <= 2 && counts[4] <= 4) ||
                        (counts[0] <= 1 && counts[1] <= 2 && counts[2] <= 3 && counts[3] <= 3 && counts[4] <= 3) ||
                        (counts[0] <= 2 && counts[1] <= 2 && counts[2] <= 2 && counts[3] <= 3 && counts[4] <= 3)) {
                    pw.println("yes");
                }
                else {
                    pw.println("no");
                }
            }
            else if (cnt == 6) {
                if ((counts[0] <= 1 && counts[1] <= 2 && counts[2] <= 2 && counts[3] <= 2 && counts[4] <= 2 && counts[5] <= 3) ||
                        (counts[0] <= 2 && counts[1] <= 2 && counts[2] <= 2 && counts[3] <= 2 && counts[4] <= 2 && counts[5] <= 2) ||
                        (counts[0] <= 1 && counts[1] <= 1 && counts[2] <= 2 && counts[3] <= 2 && counts[4] <= 3 && counts[5] <= 3) ||
                        (counts[0] <= 1 && counts[1] <= 1 && counts[2] <= 1 && counts[3] <= 3 && counts[4] <= 3 && counts[5] <= 3)) {
                    pw.println("yes");
                }
                else {
                    pw.println("no");
                }
            }
        }
        else {
            pw.println("no");
        }
    }

    public void run() {
        solve();
        pw.close();
    }

    public static void main(String[] args) {
        /*br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));*/


        /*int counter = 0;
        try {
            BufferedReader br1 = new BufferedReader(new FileReader("counter.txt"));
            counter = Integer.parseInt(br1.readLine());
            br1.close();

            PrintWriter pw1 = new PrintWriter("counter.txt");
            pw1.println(counter + 1);
            pw1.close();
        }
        catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        catch (IOException e) {
            e.printStackTrace();
        }*/

        /*try {
            br = new BufferedReader(new FileReader("input" + counter + ".txt"));
            pw = new PrintWriter("output" + counter + ".txt");
        }
        catch (FileNotFoundException e) {
            throw new RuntimeException("RuntimeException");
        }*/
        try {
            br = new BufferedReader(new FileReader("mstr.in"));
            pw = new PrintWriter("mstr.out");
        }
        catch (FileNotFoundException e) {
            throw new RuntimeException("RuntimeException");
        }

        new Thread(new Task14()).start();
    }
}